package com.sgb.trip.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * Time:2021/10/9
 * Author:黄淋
 * Description:乘客信息
 */
public class PassengerInfoEntity implements Serializable, Parcelable {

    private String id;

    private String companyNo;//企业编号

    private int cardType;//证件类型1-身份证

    private int sex;//性别：0-女，1-男

    @SerializedName(value = "name", alternate = "passengerName")
    private String name;//姓名

    @SerializedName(value = "idCard", alternate = "cardNo")
    private String idCard;//身份证号


    @SerializedName(value = "telephone", alternate = "passengerPhone")
    private String telephone;//联系电话

    private boolean isSelected;//是否选中

    public PassengerInfoEntity() {
    }

    protected PassengerInfoEntity(Parcel in) {
        id = in.readString();
        companyNo = in.readString();
        cardType = in.readInt();
        sex = in.readInt();
        name = in.readString();
        idCard = in.readString();
        telephone = in.readString();
        isSelected = in.readByte() != 0;
    }

    public static final Creator<PassengerInfoEntity> CREATOR = new Creator<PassengerInfoEntity>() {
        @Override
        public PassengerInfoEntity createFromParcel(Parcel in) {
            return new PassengerInfoEntity(in);
        }

        @Override
        public PassengerInfoEntity[] newArray(int size) {
            return new PassengerInfoEntity[size];
        }
    };

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCompanyNo() {
        return companyNo;
    }

    public void setCompanyNo(String companyNo) {
        this.companyNo = companyNo;
    }

    public int getCardType() {
        return cardType;
    }

    public void setCardType(int cardType) {
        this.cardType = cardType;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(id);
        parcel.writeString(companyNo);
        parcel.writeInt(cardType);
        parcel.writeInt(sex);
        parcel.writeString(name);
        parcel.writeString(idCard);
        parcel.writeString(telephone);
        parcel.writeByte((byte) (isSelected ? 1 : 0));
    }
}
